﻿namespace Oddo.Concept.Crm.Server.Repository.DataAccess
{
    using System;
    using System.Linq;
    using System.Linq.Expressions;
    using Oddo.Concept.Crm.Common.Interfaces;
    using Oddo.Concept.Crm.Models;
    using System.Collections.Generic;

    public interface ICountryDataAccess : IDataAccess<Country>
    {
    }

    public class CountryDataAccess : DataAccessBase<Country>, ICountryDataAccess
    {
        #region COUNTRIES

        private IEnumerable<Country> _countries = new List<Country>
            {
                new Country {Id = 1, Code = "106", Name = "Channel Islands"},
                new Country {Id = 2, Code = "999", Name = "- unknown -"},
                new Country {Id = 3, Code = "AFG", Name = "Afghanistan"},
                new Country {Id = 4, Code = "AGO", Name = "Angola"},
                new Country {Id = 5, Code = "ALB", Name = "Albania"},
                new Country {Id = 6, Code = "AND", Name = "Andorra"},
                new Country {Id = 7, Code = "ANT", Name = "Netherlands West Indies"},
                new Country {Id = 8, Code = "ARE", Name = "United Arab Emirates"},
                new Country {Id = 9, Code = "ARG", Name = "Argentina"},
                new Country {Id = 10, Code = "ARM", Name = "Armenia"},
                new Country {Id = 11, Code = "ASI", Name = "ASIA"},
                new Country {Id = 12, Code = "ATG", Name = "Antigua and Barbuda"},
                new Country {Id = 13, Code = "AUS", Name = "Australia"},
                new Country {Id = 14, Code = "AUT", Name = "Austria"},
                new Country {Id = 15, Code = "AZE", Name = "Azerbaijan"},
                new Country {Id = 16, Code = "BDI", Name = "Burundi"},
                new Country {Id = 17, Code = "BEL", Name = "Belgium"},
                new Country {Id = 18, Code = "BEN", Name = "Benin"},
                new Country {Id = 19, Code = "BFA", Name = "Burkina Faso"},
                new Country {Id = 20, Code = "BGD", Name = "Bangladesh"},
                new Country {Id = 21, Code = "BGR", Name = "Bulgaria"},
                new Country {Id = 22, Code = "BHR", Name = "Bahrain"},
                new Country {Id = 23, Code = "BHS", Name = "Bahamas"},
                new Country {Id = 24, Code = "BIH", Name = "Bosnia and Herzegovina"},
                new Country {Id = 25, Code = "BLR", Name = "Belarus"},
                new Country {Id = 26, Code = "BMU", Name = "Bermuda"},
                new Country {Id = 27, Code = "BOL", Name = "Bolivia, Plurinational State of"},
                new Country {Id = 28, Code = "BRA", Name = "Brazil"},
                new Country {Id = 29, Code = "BRN", Name = "Brunei Darussalam"},
                new Country {Id = 30, Code = "BTN", Name = "Bhutan"},
                new Country {Id = 31, Code = "BWA", Name = "Botswana"},
                new Country {Id = 32, Code = "CAF", Name = "Central African Republic"},
                new Country {Id = 33, Code = "CAN", Name = "Canada"},
                new Country {Id = 34, Code = "CHE", Name = "Switzerland"},
                new Country {Id = 35, Code = "CHL", Name = "Chile"},
                new Country {Id = 36, Code = "CHN", Name = "China"},
                new Country {Id = 37, Code = "CIV", Name = "Côte d'Ivoire"},
                new Country {Id = 38, Code = "CMR", Name = "Cameroon"},
                new Country {Id = 39, Code = "COG", Name = "Congo"},
                new Country {Id = 40, Code = "COL", Name = "Colombia"},
                new Country {Id = 41, Code = "COM", Name = "Comoros"},
                new Country {Id = 42, Code = "CPV", Name = "Cape Verde"},
                new Country {Id = 43, Code = "CUB", Name = "Cuba"},
                new Country {Id = 44, Code = "CYM", Name = "Cayman Islands"},
                new Country {Id = 45, Code = "CZE", Name = "Czech Republic"},
                new Country {Id = 46, Code = "DEU", Name = "Germany"},
                new Country {Id = 47, Code = "DJI", Name = "Djibouti"},
                new Country {Id = 48, Code = "DNK", Name = "Denmark"},
                new Country {Id = 49, Code = "DZA", Name = "Algeria"},
                new Country {Id = 50, Code = "ECU", Name = "Ecuador"},
                new Country {Id = 51, Code = "EGY", Name = "Egypt"},
                new Country {Id = 52, Code = "ERI", Name = "Eritrea"},
                new Country {Id = 53, Code = "ERL", Name = "EUROLAND"},
                new Country {Id = 54, Code = "ESP", Name = "Spain"},
                new Country {Id = 55, Code = "ETH", Name = "Ethiopia"},
                new Country {Id = 56, Code = "EUR", Name = "Europe"},
                new Country {Id = 57, Code = "FIN", Name = "Finland"},
                new Country {Id = 58, Code = "FRA", Name = "France"},
                new Country {Id = 59, Code = "GAB", Name = "Gabon"},
                new Country {Id = 60, Code = "GBR", Name = "United Kingdom"},
                new Country {Id = 61, Code = "GHA", Name = "Ghana"},
                new Country {Id = 62, Code = "GIB", Name = "Gibraltar"},
                new Country {Id = 63, Code = "GIN", Name = "Guinea"},
                new Country {Id = 64, Code = "GMB", Name = "Gambia"},
                new Country {Id = 65, Code = "GNB", Name = "Guinea-Bissau"},
                new Country {Id = 66, Code = "GRC", Name = "Greece"},
                new Country {Id = 67, Code = "GRD", Name = "Grenada"},
                new Country {Id = 68, Code = "GTM", Name = "Guatemala"},
                new Country {Id = 69, Code = "GUF", Name = "French Guiana"},
                new Country {Id = 70, Code = "HKG", Name = "Hong Kong"},
                new Country {Id = 71, Code = "HRV", Name = "Croatia"},
                new Country {Id = 72, Code = "HUN", Name = "Hungary"},
                new Country {Id = 73, Code = "IDN", Name = "Indonesia"},
                new Country {Id = 74, Code = "IND", Name = "India"},
                new Country {Id = 75, Code = "IRL", Name = "Ireland"},
                new Country {Id = 76, Code = "IRN", Name = "Iran, Islamic Republic of"},
                new Country {Id = 77, Code = "IRQ", Name = "Iraq"},
                new Country {Id = 78, Code = "ISL", Name = "Iceland"},
                new Country {Id = 79, Code = "ISR", Name = "Israel"},
                new Country {Id = 80, Code = "ITA", Name = "Italy"},
                new Country {Id = 81, Code = "JEY", Name = "Jersey"},
                new Country {Id = 82, Code = "JOR", Name = "Jordan"},
                new Country {Id = 83, Code = "JPN", Name = "Japan"},
                new Country {Id = 84, Code = "KAZ", Name = "Kazakhstan"},
                new Country {Id = 85, Code = "KEN", Name = "Kenya"},
                new Country {Id = 86, Code = "KGZ", Name = "Kyrgyzstan"},
                new Country {Id = 87, Code = "KHM", Name = "Cambodia"},
                new Country {Id = 88, Code = "KOR", Name = "Korea, Republic of"},
                new Country {Id = 89, Code = "KWT", Name = "Kuwait"},
                new Country {Id = 90, Code = "KZ ", Name = "Kazakstan"},
                new Country {Id = 91, Code = "LAO", Name = "Lao People's Democratic Republic"},
                new Country {Id = 92, Code = "LBN", Name = "Lebanon"},
                new Country {Id = 93, Code = "LBR", Name = "Liberia"},
                new Country {Id = 94, Code = "LBY", Name = "Libya"},
                new Country {Id = 95, Code = "LIE", Name = "Liechtenstein"},
                new Country {Id = 96, Code = "LKA", Name = "Sri Lanka"},
                new Country {Id = 97, Code = "LSO", Name = "Lesotho"},
                new Country {Id = 98, Code = "LUX", Name = "Luxembourg"},
                new Country {Id = 99, Code = "MAC", Name = "Macao"},
                new Country {Id = 100, Code = "MAR", Name = "Morocco"},
                new Country {Id = 101, Code = "MCO", Name = "Monaco"},
                new Country {Id = 102, Code = "MDA", Name = "Moldova, Republic of"},
                new Country {Id = 103, Code = "MDG", Name = "Madagascar"},
                new Country {Id = 104, Code = "MDV", Name = "Maldives"},
                new Country {Id = 105, Code = "MEX", Name = "Mexico"},
                new Country {Id = 106, Code = "MHL", Name = "Marshall Islands"},
                new Country {Id = 107, Code = "MKD", Name = "Macedonia, the former Yugoslav Republic of"},
                new Country {Id = 108, Code = "MLI", Name = "Mali"},
                new Country {Id = 109, Code = "MLT", Name = "Malta"},
                new Country {Id = 110, Code = "MMR", Name = "Myanmar"},
                new Country {Id = 111, Code = "MNE", Name = "Montenegro"},
                new Country {Id = 112, Code = "MNG", Name = "Mongolia"},
                new Country {Id = 113, Code = "MOZ", Name = "Mozambique"},
                new Country {Id = 114, Code = "MRT", Name = "Mauritania"},
                new Country {Id = 115, Code = "MSR", Name = "Montserrat"},
                new Country {Id = 116, Code = "MUS", Name = "Mauritius"},
                new Country {Id = 117, Code = "MYS", Name = "Malaysia"},
                new Country {Id = 118, Code = "NAM", Name = "Namibia"},
                new Country {Id = 119, Code = "NER", Name = "Niger"},
                new Country {Id = 120, Code = "NGA", Name = "Nigeria"},
                new Country {Id = 121, Code = "NIC", Name = "Nicaragua"},
                new Country {Id = 122, Code = "NIU", Name = "Niue"},
                new Country {Id = 123, Code = "NLD", Name = "Netherlands"},
                new Country {Id = 124, Code = "NOR", Name = "Norway"},
                new Country {Id = 125, Code = "NPL", Name = "Nepal"},
                new Country {Id = 126, Code = "NRU", Name = "Nauru"},
                new Country {Id = 127, Code = "PAK", Name = "Pakistan"},
                new Country {Id = 128, Code = "PER", Name = "Peru"},
                new Country {Id = 129, Code = "PHL", Name = "Philippines"},
                new Country {Id = 130, Code = "POL", Name = "Poland"},
                new Country {Id = 131, Code = "PRK", Name = "Korea, Democratic People's Republic of"},
                new Country {Id = 132, Code = "PRT", Name = "Portugal"},
                new Country {Id = 133, Code = "PSE", Name = "Palestinian Territory, Occupied"},
                new Country {Id = 134, Code = "QAT", Name = "Qatar"},
                new Country {Id = 135, Code = "RUS", Name = "Russian Federation"},
                new Country {Id = 136, Code = "RWA", Name = "Rwanda"},
                new Country {Id = 137, Code = "SAU", Name = "Saudi Arabia"},
                new Country {Id = 138, Code = "SCO", Name = "Scotland"},
                new Country {Id = 139, Code = "SEN", Name = "Senegal"},
                new Country {Id = 140, Code = "SGP", Name = "Singapore"},
                new Country {Id = 141, Code = "SLE", Name = "Sierra Leone"},
                new Country {Id = 142, Code = "SOM", Name = "Somalia"},
                new Country {Id = 143, Code = "SRB", Name = "Serbia"},
                new Country {Id = 144, Code = "SSD", Name = "South Sudan"},
                new Country {Id = 145, Code = "STP", Name = "Sao Tome and Principe"},
                new Country {Id = 146, Code = "SWE", Name = "Sweden"},
                new Country {Id = 147, Code = "SWZ", Name = "Swaziland"},
                new Country {Id = 148, Code = "SYC", Name = "Seychelles"},
                new Country {Id = 149, Code = "SYR", Name = "Syrian Arab Republic"},
                new Country {Id = 150, Code = "TCD", Name = "Chad"},
                new Country {Id = 151, Code = "TGO", Name = "Togo"},
                new Country {Id = 152, Code = "THA", Name = "Thailand"},
                new Country {Id = 153, Code = "TJK", Name = "Tajikistan"},
                new Country {Id = 154, Code = "TKM", Name = "Turkmenistan"},
                new Country {Id = 155, Code = "TLS", Name = "Timor-Leste"},
                new Country {Id = 156, Code = "TTO", Name = "Trinidad and Tobago"},
                new Country {Id = 157, Code = "TUN", Name = "Tunisia"},
                new Country {Id = 158, Code = "TUR", Name = "Turkey"},
                new Country {Id = 159, Code = "TWN", Name = "Taiwan, Province of China"},
                new Country {Id = 160, Code = "TZA", Name = "Tanzania, United Republic of"},
                new Country {Id = 161, Code = "UGA", Name = "Uganda"},
                new Country {Id = 162, Code = "USA", Name = "United States"},
                new Country {Id = 163, Code = "UZB", Name = "Uzbekistan"},
                new Country {Id = 164, Code = "VEN", Name = "Venezuela, Bolivarian Republic of"},
                new Country {Id = 165, Code = "VGB", Name = "Virgin Islands, British"},
                new Country {Id = 166, Code = "VNM", Name = "Viet Nam"},
                new Country {Id = 167, Code = "YEM", Name = "Yemen"},
                new Country {Id = 168, Code = "ZAF", Name = "South Africa"},
                new Country {Id = 169, Code = "ZMB", Name = "Zambia"},
                new Country {Id = 170, Code = "ZWE", Name = "Zimbabwe"},
            };

        #endregion

        public override IQueryable<Country> Query()
        {
            return _countries.AsQueryable();
        }

        public override IQueryable<Country> Query(Expression<Func<Country, bool>> predicate)
        {
            return _countries.AsQueryable().Where(predicate);
        }

        public override Country Save(Country value)
        {
            return value;
        }

        public override void Delete(Country value)
        {
        }
    }
}